class_name Dark_knight
extends Interactable

var is_activated: bool = false
var player_in_range: bool = false

func interact() -> void:
	super()
	show_end_screen()

func _process(delta):
	if player_in_range and Input.is_action_just_pressed("interact"):
		show_end_screen()

func _on_body_entered(body):
	if body is Player:
		player_in_range = true

func _on_body_exited(body):
	if body is Player:
		player_in_range = false

func show_end_screen() -> void:
	await get_tree().create_timer(0.5).timeout
	SceneManage.go_to_end_screen()
